package com.shop2cn.iapi.couponmanage.service;

import com.shop2cn.iapi.coupon.parameter.GetPagingUserCouponListReturnData;
import com.shop2cn.iapi.couponmanage.parameter.GetBagsByPaging;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;
/**
*分页获取套券Call
*FreeMaker Template自动生成代码
*/
public class queryBagCall extends YmatouBaseCall{
	private static String opurl ="api/couponbag/queryBag";
	
	public queryBagCall() {
		super(EnvSetup.getSystemUrl("couponmanage_shop2cn_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public String getStatusCode1() {
		return getString("statusCode");
	}

	public String getMessage() {
		return getString("message");
	}

	public String getRecordCount() {
		return getString("recordCount");
	}
	
	public String getData() {
		return getString("data");
	}

	public GetBagsByPaging getBagInfosReturnData() {
		GetBagsByPaging data = null;
		try {
			data = (GetBagsByPaging) FormatUtil.GSONToObject(DataUtil.Json.parseJsonObj(getData()).toString(),
					GetBagsByPaging.class);

		} catch (Exception e) {
			e.printStackTrace();
		}
		return data;
	}
}